#include "StdAfx.h"
#include "CBoardCell.h"

BEGIN_MESSAGE_MAP(CBoardCell, CWnd)
END_MESSAGE_MAP()

CBoardCell::CBoardCell(void)
{
	m_nCellID		= 0;
	/*m_CellColor		= Color::Aqua;
	m_szCellImage	= FOLDERIMAGE_INACTIVE;*/
	m_bClicked		= FALSE;
}

CBoardCell::~CBoardCell(void)
{
}

CBoardCell::CBoardCell(int nCellID/*, Color CellColor, int nWidth, int nHeight*/)
{
	m_nCellID		= nCellID;
	/*m_CellColor	= CellColor;*/
	/*m_nWidth	= nWidth;
	m_nHeight	= nHeight;*/
	m_bClicked		= FALSE;
}

int CBoardCell::getCellID()
{
	return m_nCellID;
}

//int CBoardCell::getWidth()
//{
//	return m_nWidth;
//}
//int CBoardCell::getHeight()
//{
//	return m_nHeight;
//}

RECT CBoardCell::getRect()
{
	return m_ClientRect;
}

void CBoardCell::setRect(RECT* rect)
{
	m_ClientRect.left	= rect->left;
	m_ClientRect.right	= rect->right;
	m_ClientRect.top	= rect->top;
	m_ClientRect.bottom = rect->bottom;
}

void CBoardCell::setCellColor(Color color)
{
	m_CellColor = color;
}

void CBoardCell::setCellImage(CString szImage)
{
	m_szCellImage = szImage;
}

void CBoardCell::DrawCell( Graphics* graphics,  RECT rect )
{
	Pen penCell(Color::LightSkyBlue, 2);
	SolidBrush	ColorBrush( m_CellColor );
	Rect rectCell(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);

	graphics->DrawRectangle(&penCell, rectCell);
	graphics->FillRectangle(&ColorBrush, rectCell);

	Rect rectImage(rect.left, rect.top, FOLDERIMAGE_WIDTH, FOLDERIMAGE_HEIGHT);
	Image image( m_szCellImage );
	graphics->DrawImage(&image, rectImage);
}
